const cateTable=document.querySelector('.cateTable')
cateTable.addEventListener('click', (e) => {
    if (e.target.classList.contains('delTypeBtn')) {
        let typeId=e.target.dataset.typeid

        customConfirm('确定要删除该类别吗', (result) => {
            if (result) {
                $.ajax({
                    url:'/weibo/manager/deleteType/'+typeId,
                    success: function (result) {
                        showCustomAlert('删除成功',true)
                    },
                    error: function (error) {
                        showCustomAlert('删除失败',false)
                    },
                });
                setTimeout(() => {
                    location.reload()
                }, 1000);
            }
        });
    }

})
const seaCateForm=document.querySelector('.seaCateForm')

seaCateForm.addEventListener('submit',function (e){
    e.preventDefault()
    seaCateForm.type.value=setText(seaCateForm.type.value)
    seaCateForm.submit()
})
const addCateForm=document.querySelector('.addCateForm')

addCateForm.addEventListener('submit',function (e){
    e.preventDefault()
    addCateForm.type.value=setText(addCateForm.type.value)
    addCateForm.submit()
})